;;; init-ebook.el --- Configuration for read ebooks -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(add-to-list 'auto-mode-alist '("\\.epub$" . nov-mode))

(with-eval-after-load 'nov
  (define-key nov-mode-map (kbd "j") #'next-line)
  (define-key nov-mode-map (kbd "k") #'previous-line)
  (define-key nov-mode-map (kbd "d") #'nov-scroll-up)
  (define-key nov-mode-map (kbd "u") #'nov-scroll-down)

  (setq nov-text-width t)
  (setq visual-fill-column-center-text t)
  (add-hook 'nov-mode-hook 'visual-line-mode))

(provide 'init-ebook)
;;; init-ebook.el ends here
